#ifndef IMU_H
#define IMU_H

#include "serial.h"
#include <ftdi.h>
#include <string>
#include <QString>
#include <iostream>
#include <sstream>

class Imu
{
  public:
    Imu();
    
    void setListen();
    void readChannels();    
    void ekfReset();    
    double getIMUData(int);
    void getData();
    
  private:
    Serial *ftdi;
   
    int readPacket(unsigned char*);
    void setActiveChannels(char,char);
    void autoSetAccelRef();
    void zeroRateGyros();
    void selfTest();
    void disableMagCorrection(); 
    
    void initVectors();
    
    void waitResponse();
    
    void printResponse(int,unsigned char*);
    
    double correct[15];    
    double imuData[15];
    
};
#endif
